package org.ccay.async.task;

import org.ccay.core.base.BaseResourceVO;
import java.util.Date;

/**
 * VO for export tasks
 * 
 * @author chaowangbang
 * @since 2012-2-17
 */
public class ExportTaskVO extends BaseResourceVO {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3120066783822100360L;

	/** 由毫秒得出秒* */
	private static final int SECOND = 1000;

	/** 任务 ID* */
	private int taskId;

	/** Task生成文件名* */
	private String fileName;

	/** Task文件大小* */
	private long fileSize;

	/** 记录总条数* */
	private Integer totalCount;

	/** 总耗时* */
	private Integer totalTime;

	/** 查询的开始时间* */
	private Date taskDateFrom;

	/** 查询的结束时间* */
	private Date taskDateTo;

	/** Task导出栏目名称* */
	private String moduleName;

	/** Task文档名称* */
	private String tmpName;

	/** 导出日期* */
	private Date exportDate;

	/** Task导出标识[ 0:等待处理,1: 处理䶿2:处理完成,3:异常中止]* */
	private String exportFlag;

	/** 导出任务创建者 * */
	private String owner;

	/** 操作人ID* */
	private String operatorId;

	/** 提取报表的用户当前角色ID* */
	private String userRoleId;

	/** 导出运行开始时长* */
	private Date runStartTime;

	/** 导出运行结束时间* */
	private Date runEndTime;

	private int day;

	/** 导出记录数目* */
	private Integer records;

	/** 导出文件类型* */
	private String docType;

	/** 导出文件唯一标识* */
	private String guid;
	
	private String downloadUrl;
	
	/**扩展属性1**/
	private String attr1;
	
	/**扩展属性2**/
	private String attr2;
	
	/**扩展属性3**/
	private String attr3;
	
	/**扩展属性4**/
	private String attr4;
	
	/**扩展属性5**/
	private String attr5;
	
	/**导出任务创建者*/
	private long currentUserId;
	

	public void setAttr1(String attr1) {
		this.attr1 = attr1;
	}
	public String getAttr1() {
		return attr1;
	}

	
	public void setAttr2(String attr2) {
		this.attr2 = attr2;
	}
	public String getAttr2() {
		return attr2;
	}

	
	public void setAttr3(String attr3) {
		this.attr3 = attr3;
	}
	public String getAttr3() {
		return attr3;
	}

	

	public String getAttr4() {
		return attr4;
	}

	public void setAttr4(String attr4) {
		this.attr4 = attr4;
	}

	public String getAttr5() {
		return attr5;
	}

	public void setAttr5(String attr5) {
		this.attr5 = attr5;
	}

	/**
	 * @return the day
	 */
	public int getDay() {
		return day;
	}

	/**
	 * @param day
	 *            the day to set
	 */
	public void setDay(int day) {
		this.day = day;
	}

	/**
	 * @return the fileName
	 */
	public String getFileName() {
		return fileName;
	}

	/**
	 * @param fileName
	 *            the fileName to set
	 */
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	/**
	 * @return the fileSize
	 */
	public long getFileSize() {
		return fileSize;
	}

	/**
	 * @param fileSize
	 *            the fileSize to set
	 */
	public void setFileSize(long fileSize) {
		this.fileSize = fileSize;
	}

	/**
	 * @return the operatorId
	 */
	public String getOperatorId() {
		return operatorId;
	}

	/**
	 * @param operatorId
	 *            the operatorId to set
	 */
	public void setOperatorId(String operatorId) {
		this.operatorId = operatorId;
	}

	/**
	 * @return the rcModuleName
	 */
	public String getModuleName() {
		return moduleName;
	}

	/**
	 * @param rcModuleName
	 *            the rcModuleName to set
	 */
	public void setMduleName(String moduleName) {
		this.moduleName = moduleName;
	}

	/**
	 * @return the rcTmpName
	 */
	public String getTmpName() {
		return tmpName;
	}

	/**
	 * @param rcTmpName
	 *            the rcTmpName to set
	 */
	public void setTmpName(String tmpName) {
		this.tmpName = tmpName;
	}

	/**
	 * @return the records
	 */
	public Integer getRecords() {
		return records;
	}

	/**
	 * @param records
	 *            the records to set
	 */
	public void setRecords(Integer records) {
		this.records = records;
	}

	/**
	 * @return the rqDate
	 */
	public Date getExportDate() {
		return exportDate;
	}

	/**
	 * @param rqDate
	 *            the rqDate to set
	 */
	public void setExportDate(Date exportDate) {
		this.exportDate = exportDate;
	}

	/**
	 * @return the rqDocType
	 */
	public String getDocType() {
		return docType;
	}

	/**
	 * @param rqDocType
	 *            the rqDocType to set
	 */
	public void setDocType(String docType) {
		this.docType = docType;
	}

	/**
	 * @return the rqFlag
	 */
	public String getExportFlag() {
		return exportFlag;
	}

	/**
	 * @param rqFlag
	 *            the rqFlag to set
	 */
	public void setExportFlag(String exportFlag) {
		this.exportFlag = exportFlag;
	}

	/**
	 * @return the rqRunEndTime
	 */
	public Date getRunEndTime() {
		return runEndTime;
	}

	/**
	 * @param rqRunEndTime
	 *            the rqRunEndTime to set
	 */
	public void setRunEndTime(Date runEndTime) {
		this.runEndTime = runEndTime;
	}

	/**
	 * @return the rqRunStartTime
	 */
	public Date getRunStartTime() {
		return runStartTime;
	}

	/**
	 * @param rqRunStartTime
	 *            the rqRunStartTime to set
	 */
	public void setRunStartTime(Date runStartTime) {
		this.runStartTime = runStartTime;
	}

	/**
	 * @return the taskId
	 */
	public int getTaskId() {
		return taskId;
	}

	/**
	 * @param taskId
	 *            the taskId to set
	 */
	public void setTaskId(int taskId) {
		this.taskId = taskId;
	}

	/**
	 * @return the totalCount
	 */
	public Integer getTotalCount() {
		return totalCount;
	}

	/**
	 * @param totalCount
	 *            the totalCount to set
	 */
	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}

	/**
	 * @return the totalTime
	 */
	public Integer getTotalTime() {
		if (runStartTime == null || runEndTime == null) {
			totalTime = 0;
		} else {
			totalTime = (int)((runEndTime.getTime() - runStartTime.getTime()) / SECOND);
		}
		return totalTime;
	}

	/**
	 * @param totalTime
	 *            the totalTime to set
	 */
	public void setTotalTime(Integer totalTime) {
		this.totalTime = totalTime;
	}

	/**
	 * @return the userRoleId
	 */
	public String getUserRoleId() {
		return userRoleId;
	}

	/**
	 * @param userRoleId
	 *            the userRoleId to set
	 */
	public void setUserRoleId(String userRoleId) {
		this.userRoleId = userRoleId;
	}

	/**
	 * @return the guid
	 */
	public String getGuid() {
		return guid;
	}

	/**
	 * @param guid
	 *            the guid to set
	 */
	public void setGuid(String guid) {
		this.guid = guid;
	}

	/**
	 * @param moduleName
	 *            the moduleName to set
	 */
	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}

	/**
	 * @return the taskDateFrom
	 */
	public Date getTaskDateFrom() {
		return taskDateFrom;
	}

	/**
	 * @param taskDateFrom
	 *            the taskDateFrom to set
	 */
	public void setTaskDateFrom(Date taskDateFrom) {
		this.taskDateFrom = taskDateFrom;
	}

	/**
	 * @return the taskDateTo
	 */
	public Date getTaskDateTo() {
		return taskDateTo;
	}

	/**
	 * @param taskDateTo
	 *            the taskDateTo to set
	 */
	public void setTaskDateTo(Date taskDateTo) {
		this.taskDateTo = taskDateTo;
	}

	/**
	 * @return the owner
	 */
	public String getOwner() {
		return owner;
	}

	/**
	 * @param owner
	 *            the owner to set
	 */
	public void setOwner(String owner) {
		this.owner = owner;
	}
	
	/**
	 * @return the downloadUrl
	 */
	public String getDownloadUrl() {
		return downloadUrl;
	}
	
	/**
	 * @param owner
	 *            the owner to downloadUrl
	 */
	public void setDownloadUrl(String downloadUrl) {
		this.downloadUrl = downloadUrl;
	}
	
	public long getCurrentUserId() {
		if (currentUserId == 0) {
			return super.getCurrentUserId();
		}
		return currentUserId;
	}
	public void setCurrentUserId(Long currentUserId) {
		if (currentUserId != null) {
			this.currentUserId = currentUserId;
		}
	}
	
	
}
